UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DE8/PdU+6/FB8FSJ1fXtZ1NqcT6DR7e+x9E0i1kHGTs=' 
WHERE 
  key_id = '4986fbb0a59494ceaba04f2de5261fbb2b2e2eac894ae0e17eecf61fed52f668' 
  AND (
    token = 'DE8/PdU+6/FB8FSJ1fXtZ1NqcT6DR7e+x9E0i1kHGTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032