UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DF5WamAj2Po6BX2FDNvu+jQNz6+NHMnuV27j6JpK97k=' 
WHERE 
  key_id = '9fc28ad7f060a31223f33ef2571116ebb51b0b0d70205920b94115655d85257b' 
  AND (
    token = 'DF5WamAj2Po6BX2FDNvu+jQNz6+NHMnuV27j6JpK97k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036