UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jDQJJzYKF21DvQyVigx5dJQqaZ2sQveMelNhH1GygyM='
WHERE
key_id = '4bcf7a2a1c4134fb899715ea2a3eacae487c684d19d8b80ed485769cbb13468c'
AND (
token = 'jDQJJzYKF21DvQyVigx5dJQqaZ2sQveMelNhH1GygyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)