UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E/w0+J49fO4tXO7QCx/yU82mfoGjxVxCaVIPjUAJPV0=' 
WHERE 
  key_id = 'd6c67e67617b2319a4544bd354973b159e86b34aefa72ad3fd52896339b11c35' 
  AND (
    token = 'E/w0+J49fO4tXO7QCx/yU82mfoGjxVxCaVIPjUAJPV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057