UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xxo+g9SQLKaGpZPCB5vdUfiPWU6StRG9hL6uYnFh5ZU='
WHERE
key_id = '67481ed63be4cbeb1b68fbb4b2f4b0f42bbaa1a9bb12dbe7cd4cd68ae8c50c3a'
AND (
token = 'xxo+g9SQLKaGpZPCB5vdUfiPWU6StRG9hL6uYnFh5ZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)