UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y0e4yWd/A7Qsioa1GzGHGFW23SakhKkoiHLLU78zqG0='
WHERE
key_id = '029f5d5118668cb25b8e3a5a4e499b84e40b7b65f5d483df7aed42a4afb4db46'
AND (
token = 'y0e4yWd/A7Qsioa1GzGHGFW23SakhKkoiHLLU78zqG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)