UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8HVrmfigDcT3ivVb+cXgaUgLP5ybfCxL/b/qVdO/suY=' 
WHERE 
  key_id = '815ee112175a0773d46c7be86843ab1934491363f0d7f01deecfb21778872d54' 
  AND (
    token = '8HVrmfigDcT3ivVb+cXgaUgLP5ybfCxL/b/qVdO/suY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034