UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wOyQDp+tl2wqbH1jzKigUDnZlckK7FPaTzRDHzd8wJ8='
WHERE
key_id = '2294b9e3b48fe00cb1bacf3ffd540a54be0e184c986afc857677043efd316d2b'
AND (
token = 'wOyQDp+tl2wqbH1jzKigUDnZlckK7FPaTzRDHzd8wJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)