UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lhAcd0f+zxsyECKGqH+0lM5+A/Jvhmf/KwQc+9eeRlM='
WHERE
key_id = 'ebd9a6800f02ee0701ce110019ef629ee9cb0132a29402752112f098f0f6a8dd'
AND (
token = 'lhAcd0f+zxsyECKGqH+0lM5+A/Jvhmf/KwQc+9eeRlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)