UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vzCPYZnUki+MUaayUZZkoUWlIRksurKrZkTr09bsVzE='
WHERE
key_id = '61f2614c7bebf8e8787e97999eafc1530d45b0aff15dec103b96e57203d210a5'
AND (
token = 'vzCPYZnUki+MUaayUZZkoUWlIRksurKrZkTr09bsVzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)