UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JOzU5zwSDTp6N1L+O86qHoXvzCL1kPpzX02g0mIbH2I=' 
WHERE 
  key_id = '4127f187b88a931723697f85984414a0788dc29c1a035cc97fe1610b54b64039' 
  AND (
    token = 'JOzU5zwSDTp6N1L+O86qHoXvzCL1kPpzX02g0mIbH2I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020