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

Query time 0.00027