UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v/jeLmlsc4K/+ojB+C/+eZpRZsl/QqC1M65+9oypmQU='
WHERE
key_id = 'ac60854aff268e5b35881d49e02fb4e24ca167e52a9000566eadc840d70eb044'
AND (
token = 'v/jeLmlsc4K/+ojB+C/+eZpRZsl/QqC1M65+9oypmQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)