UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4leFjJMZ5hJc3J7Rwh9OqNaUt0sahx62bk3mrdbv4Aw='
WHERE
key_id = 'c121402fee178ce60ef2cf43614d858f73901522cdade8b472cf75eae4d8ad5f'
AND (
token = '4leFjJMZ5hJc3J7Rwh9OqNaUt0sahx62bk3mrdbv4Aw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)