UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IwAizaQ9Qcry3j+BGGK6pqTkAG4mxPq/dLxRTnOX6uI='
WHERE
key_id = '4af8b5d31bb24e2fdca513ec098aa79029bd8640ed5488ba0d1ebcb7b72e76ec'
AND (
token = 'IwAizaQ9Qcry3j+BGGK6pqTkAG4mxPq/dLxRTnOX6uI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)