UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DBaGv+KvOxnrwE2yzeIEiVL+SHpJHcrDIUmYcqNRC9c='
WHERE
key_id = 'bfe5fc534f33c4461e79ab872a5eb126049a4a9969e624decee971b121092642'
AND (
token = 'DBaGv+KvOxnrwE2yzeIEiVL+SHpJHcrDIUmYcqNRC9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)