UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6CyU45jP1eMhnqfx7/cps5HQa5GF+OVaoc7LIpt/mJU='
WHERE
key_id = '24d4611b26138d5c8af976f8e29c5c4237e49ce3f1d063fa4414d643bb5fd23d'
AND (
token = '6CyU45jP1eMhnqfx7/cps5HQa5GF+OVaoc7LIpt/mJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)