UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v2orV56zsLmWldiWuN/SVCZgP+prI0RHJxA+Rwh5pyE='
WHERE
key_id = '3eb14e906d8967748325d3ef813f5f632acd76301b7643117025e32d9aba2741'
AND (
token = 'v2orV56zsLmWldiWuN/SVCZgP+prI0RHJxA+Rwh5pyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)