UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i6qMRQEWrgoCuli0hsY/N9sGQRpXAlf7UnJ+OYaF7D4='
WHERE
key_id = 'a031fa26d3dc450fc42905ac3c8d9abac533640de41faa9a44521685701a221a'
AND (
token = 'i6qMRQEWrgoCuli0hsY/N9sGQRpXAlf7UnJ+OYaF7D4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)