UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vqpeK4iifARlDRKaYbwyBp1//urivpI+QLaBy+9Htk0=' 
WHERE 
  key_id = '01bcdfc69bd50bbe491b4bbc8f1eadd19912433195c490d9af2ae2de8dc3c38c' 
  AND (
    token = 'vqpeK4iifARlDRKaYbwyBp1//urivpI+QLaBy+9Htk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037