UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VMnxIj1lLeqAy7tmS2a5/0T71av4VmQ89+ckXMrP/fM='
WHERE
key_id = 'fe41d9e81f295e5d09250d147895a6708193773f4e296b8b3eb891bc93fa70e1'
AND (
token = 'VMnxIj1lLeqAy7tmS2a5/0T71av4VmQ89+ckXMrP/fM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)