UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cE0zq6+P4PmmHvoV/VjncwhzX4REQwYTe4znjDADJ6k='
WHERE
key_id = 'cf6d44047b9f666ac85e43cfa2613d83ac9d4e9c8779d639dc57cfcb57d46e73'
AND (
token = 'cE0zq6+P4PmmHvoV/VjncwhzX4REQwYTe4znjDADJ6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)