UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nHab+59t9oIgOubAbuqocD9hbJKwLZYqtgk1pErgZlo='
WHERE
key_id = '90a726a8cb94f42e47c8ac7f467aac68b45bd5d912f927009703f0e694198c3c'
AND (
token = 'nHab+59t9oIgOubAbuqocD9hbJKwLZYqtgk1pErgZlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)