UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wRAv1VwB6vC/RVnUwET1//TnUx56f4TRyDJiRgRYlbI=' 
WHERE 
  key_id = 'e50bc1eb631cd13ecc318528454c187bbb51d20e114ba50b1ce5e3d0e95d1d48' 
  AND (
    token = 'wRAv1VwB6vC/RVnUwET1//TnUx56f4TRyDJiRgRYlbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075