UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2M7WGcXs2gJRB+iDg9c0JLMU9l5C+N7cad/ykWKIPLc='
WHERE
key_id = 'c1c81fc5c2b9081ceb807c7ba936dd8d7d1be905668532a2ab8bbb47da3d9b0c'
AND (
token = '2M7WGcXs2gJRB+iDg9c0JLMU9l5C+N7cad/ykWKIPLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)