UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GdXmzfBMQbAGESGx7XyFqHFkD4g2FCoG6LV1sUrQ4yc='
WHERE
key_id = 'f3375d22d87d634fd657592ee1904ef9d321818c00d0e52cde8ef1ad4edd81e7'
AND (
token = 'GdXmzfBMQbAGESGx7XyFqHFkD4g2FCoG6LV1sUrQ4yc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)