UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '50cQW3kWCrKAUyCY6hnPVORRrhvKlFa4FiMf274XT2M=' 
WHERE 
  key_id = '5683e4e7507de2660af9d3ce275ef719468b10f72b6b08fc87369789c1900862' 
  AND (
    token = '50cQW3kWCrKAUyCY6hnPVORRrhvKlFa4FiMf274XT2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029