UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q7tFsqhw6qou5QaAa9uC/HPq56IIamorFqqHILtQ/xI=' 
WHERE 
  key_id = 'e8533e9aaf89e30a8c6522075e6ab72a816a23fafd361e89eede596a36cea72b' 
  AND (
    token = 'Q7tFsqhw6qou5QaAa9uC/HPq56IIamorFqqHILtQ/xI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038