UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZaOLPZCCFYD28tuZvrDLLPXiNpnsXw14gJFin83Wk9k='
WHERE
key_id = '8b18a1a7ffeea189cf97a23b128963c2a3b381c1d2bde742aeff4d361f5967c3'
AND (
token = 'ZaOLPZCCFYD28tuZvrDLLPXiNpnsXw14gJFin83Wk9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)