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