UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5hQwdAMY2rL4dTqzlry09bytbcz8rldIxQNaLYzq9jc=' 
WHERE 
  key_id = '1e0dbefd428b6c5f2f00befb2bb09d3739f0538ea7b5eac9861caa04675847dd' 
  AND (
    token = '5hQwdAMY2rL4dTqzlry09bytbcz8rldIxQNaLYzq9jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027