UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z4e/FyOhQfXaHTiZXXf6nTxJzTAK6ls/En2V3+h6M90='
WHERE
key_id = 'eb0059ae93500f0c3dd641e838fef9d68d965dafeab8fe713a332273398ea562'
AND (
token = 'Z4e/FyOhQfXaHTiZXXf6nTxJzTAK6ls/En2V3+h6M90='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)