UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EbDlypje58QKOS/odGCnTu5If2KLrXmmzWOZ9AbYr/0='
WHERE
key_id = 'bca30dcc68069dcb428144a3bf33f85b477717edbe965101d02b5088b27321d4'
AND (
token = 'EbDlypje58QKOS/odGCnTu5If2KLrXmmzWOZ9AbYr/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)