UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uUPjNGkibRuq28D9qdoAwJYUoqr/FeJvAWti53r7zjI='
WHERE
key_id = 'c6c9404be703b6d0ee7ad45fc385f18184b8f456e85a4ae494e838b4ab16eac9'
AND (
token = 'uUPjNGkibRuq28D9qdoAwJYUoqr/FeJvAWti53r7zjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)