UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q/DrNjQHXswR7OfO2mD+88TOVrzoQhpwVo/5llCPo0o='
WHERE
key_id = 'b0d53589b5d30681c44c1a2bc6b9a74274e281f9498e731fba125950b4fcf288'
AND (
token = 'q/DrNjQHXswR7OfO2mD+88TOVrzoQhpwVo/5llCPo0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)