UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5z0FyyTQFjG3I9ngEUH73ElJxSmAZn8k9Pxzlc5CRSg='
WHERE
key_id = 'f2b2422399815112d6aa017f92bfa6165ad1c210ce622d9c54f6a314f8a8ab30'
AND (
token = '5z0FyyTQFjG3I9ngEUH73ElJxSmAZn8k9Pxzlc5CRSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)