UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ETe742NBhP3ZOFePMzLbEQn2F7jZ7aBtU6wB4DIIYrg='
WHERE
key_id = '10afd3d4fa1af8e81d332ccf1e8ee1d4274ceec1bd9d48290d5899a93a243da6'
AND (
token = 'ETe742NBhP3ZOFePMzLbEQn2F7jZ7aBtU6wB4DIIYrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)