UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1TBLxf5LkP/og5fWFPIO8hvn8oHcEzVDSVkrgVGVxIM='
WHERE
key_id = '57f085f897270a66e96da786fb77fc1e710d7e70cd42a0837c61f3671bf9c79b'
AND (
token = '1TBLxf5LkP/og5fWFPIO8hvn8oHcEzVDSVkrgVGVxIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)